﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace AttrapeMoi
{
    class Gendarme
    {
        private Vector2 position;
        private Vector2 ancienne_position;

        public Vector2 Ancienne_position
        {
            get { return ancienne_position; }
            set { ancienne_position = value; }
        }

        public Vector2 Position
        {
            get { return position; }
        }

        public Gendarme(int x, int y)
        {
            position = new Vector2(x, y);
        }

        public virtual void calculer_nouvelle_position(Carte carte)
        {
            int i = Direction(carte);
            carte.getCase(position).Contenu1 = Contenu.vide;
            ancienne_position = position;
            position = carte.convertNumToXY(i);
            carte.getCase(position).Contenu1 = Contenu.gendarme;
        }

        private int Direction(Carte carte)
        {
            Vector2 rep = Djikstra.Direction1(position, carte.Voleur, carte);
            int x = (int)rep.X;
            int y = (int)rep.Y;
            return carte.convertXYToNum(x, y);
        }


    }
}
